/**
 * Copyright 2013 DJSearch Co.,Ltd. All rights reserved.
 * DTM PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.djsearch.router;

import java.util.HashMap;
import java.util.Map;

/**
 * @author dingzhongchang
 * @version 1.0.0
 */
public class DefaultRouter implements IRouter {
	private static String DefaultMethodPath = IRouter.IP;
	private Map<String, String> cache = new HashMap<String ,String>();
	/**
	 * 构造Router
	 */
	public DefaultRouter(){
		init();
	}

	private void init() {
		//默认路径
		// 注册
		// http://IP/djs/register/start.jsp?data=
		cache.put("register", IRouter.IP+"/awp/jsp/cuser!reg.shtml?");
		//一键注册
//		registerReplay
		cache.put("registerReplay", IRouter.IP+"/awp/jsp/cuser!oneKeyReg.shtml");
		//登录
		cache.put("login", IRouter.IP+ "/awp/jsp/cuser!login.shtml");
		//绑定微博
		cache.put("weibo", IRouter.IP+ "/djs/weibo/bind.jsp");
		//微博登录
		cache.put("sina", IRouter.IP+ "/djs/sina/bind.jsp");
		//我的订单
		cache.put("myorder", IRouter.IP+ "/djs/myorder.jsp");
		//绑定手机号
		cache.put("telephone", IRouter.IP+ "/awp/jsp/cuser!bindPhone.shtml");
		//绑定推荐人
		cache.put("recommendperson", IRouter.IP+ "/djs/bind/recommendperson.jsp");
		//修改个人信息
		cache.put("edit", IRouter.IP+ "/djs/edit/information.jsp");
		//增加代金卷
		cache.put("add", IRouter.IP+ "/djs/add/jifen.jsp");
		//消费代金卷
		cache.put("remove", IRouter.IP+ "/djs/remove/jifen.jsp");
		//搜应用 
		cache.put("search", IRouter.IP+ "/awp/jsp/business!app.shtml");
		//栏目分类
		cache.put("subject", IRouter.IP+ "/awp/jsp/business!sort.shtml");
		//团购
		cache.put("teamshop", IRouter.IP+ "/awp/jsp/business!shop.shtml");
		//酒店
		cache.put("house", IRouter.IP+ "/awp/jsp/ctrip!hotel.shtml");
		//电影
		cache.put("movie", IRouter.IP+ "/awp/jsp/business!film.shtml");
		//淘购
		cache.put("taogou", IRouter.IP+ "/awp/jsp/tg.shtml");
		//机票
		cache.put("plane", IRouter.IP+ "/awp/jsp/ctrip!ticket.shtml");
		//便民充值
		cache.put("recharge", IRouter.IP+ "/djs/recharge/ready.jsp");
		//开始充值
		cache.put("varcher", IRouter.IP+ "/djs/varcher.jsp");
		//景点首页图片
		cache.put("jingdian_picture", IRouter.IP+ "/djs/jingdian/picture.jsp");
		//景点城市搜索
		cache.put("jingdian_city", IRouter.IP+ "/djs/jingdian/city.jsp");
		//景点搜索
		cache.put("jingdian_search", IRouter.IP+ "/djs/jingdian/search.jsp");
		//收藏
		cache.put("collect", IRouter.IP+ "/awp/jsp/business!collect.shtml");
		//我的收藏
		cache.put("mycollect", IRouter.IP+ "/awp/jsp/business!myCollect.shtml");
		//万能搜
		cache.put("wanneng_search", IRouter.IP+ "/awp/jsp/business!sort.shtml");
		//淘购中产品分类
		cache.put("taogou_sort", IRouter.IP+ "/awp/jsp/tg!sort.shtml");
		//旅游
		cache.put("travel", IRouter.IP+ "/awp/jsp/travel!query.shtml");
		//团购分类
		cache.put("groupshop_sort", IRouter.IP+ "/awp/jsp/business!tgSort.shtml");
		//编辑信息
		cache.put("edit_info", IRouter.IP+ "/awp/jsp/cuser!edit.shtml");
//		ocalhost:8080/awp/jsp/cuser!edit.shtml?data={"userId":"8765","newUserId":"","newPassword":""}
		//分享到微博
		cache.put("share", IRouter.IP+ "/awp/jsp/blog!add.shtml");
		//微博数据
		cache.put("weibo", IRouter.IP+ "/awp/jsp/blog!list.shtml");

		
	}

	/** 
	 * @return
	 * @see com.djsearch.router.IRouter#getMethodPath()
	 */
	@Override
	public String getMethodPath(String method) {
		if(cache.containsKey(method)){
			return cache.get(method);
		}
		return DefaultMethodPath;
	}

}
